use std::collections::HashMap;

pub fn new_count_distinct(input_str: &str) -> usize {
    let mut hash: HashMap<String, usize> = HashMap::new();
    for item in input_str.split(',').into_iter() {
        let key = item.to_owned();
        let count = hash.get(&key);
        match count {
            Some(c) => {
                hash.insert(key, c + 1);
            }
            None => {
                hash.insert(key, 1);
            }
        }
    }
    hash.iter().count()
}
